#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
	int r;
	long long count=0;
	cin>>r;
	while(r)
	{
		count=0;
		for(int a=1;a<r;a++)
		{
			count+=floor(sqrt(r*r-a*a));
		}
		cout<<count*4+r*4+1<<endl;
		cin>>r;
	}
	return 0;
}
